/*
 * @Description:
 * @Author: dh
 * @Date: 2021-08-23 14:06:13
 * @LastEditors: dh
 * @LastEditTime: 2022-03-29 16:06:37
 */

const a = { val: 'a' }
const b = { val: 'b' }
const c = { val: 'c' }
const d = { val: 'd' }
a.next = b
b.next = c
c.next = d

// 遍历链表
let p = a
while (p) {
	console.log(p.val)
	p = p.next
}

// 插入 c和d之间插入
const e = { val: 'e' }
c.next = e
e.next = d

// 删除 e
c.next = d
